package com.lanlan.deploy;

import javax.sql.DataSource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
 * 
 * @ClassName: Application
 * @Description: 启动类
 * @author XGJ
 * @date 2022-10-13 10:09:11
 */
@SpringBootApplication
public class Application implements CommandLineRunner {

    private Logger logger = LoggerFactory.getLogger(Application.class);

    /**
     * 用户数据源
     */
    @Autowired
    private DataSource dataSource;

    public static void main(String[] args) {
	// 启动 Spring Boot 应用
	SpringApplication.run(Application.class, args);
    }

    /**
     * @Title: run
     * @Description: TODO(描述)
     * @param args
     * @throws Exception
     * @see org.springframework.boot.CommandLineRunner#run(java.lang.String[])
     * @author XGJ
     * @date 2022-10-13 03:56:03
     */
    @Override
    public void run(String... args) throws Exception {
	// user 数据源
	logger.info("[run][获得数据源dataSource：{}]", dataSource.getClass());
    }

}
